package com.session07;

public class StaticInnerDemo {
    static int a = 10;
    int b = 20;

    static void f() {
        System.out.println("我在静态⽅法f()中");
    }

    static class Inner { //定义⼀个静态内部类
        int c = 30;

        public void g() {
            f(); //调⽤外部类的静态⽅法f()
//System.out.println(b); //如果此句不注释点，会出现编译错误
            System.out.println(a + " " + c); //引⽤外部类的静态变量
        }
    }

    public static void main(String[] args) {
        Inner ob = new Inner(); //直接调⽤静态内部类
        ob.g();
    }
}
